package com.dartfar.base.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.dartfar.base.dao.DaoUtil;
import com.dartfar.base.model.Person;
import com.dartfar.base.model.T_User;

@Component("personService")
public class PersonServiceImpl extends BaseServiceImpl<Person> implements PersonService {
	
	@Resource
	private DaoUtil<Person> personDaoUtil;
	
	
	/**
	 * 根据人员ID 获取人员对象
	 */
	@Override
	public Person getPersonById(int id){
		return (Person) personDaoUtil.get("from Person p where p.personId = " + id);
	}
	
	/**
	 * 获取用户列表
	 */
	@Override
	public List<Person> getList() {
		// TODO Auto-generated method stub
		return personDaoUtil.getList("from Person");
	}
	
	/**
	 * 根据IDS获取用户列表
	 */
	@Override
	public List<Person> getListByIds(String ids){
		// TODO Auto-generated method stub
		return personDaoUtil.getList("from Person p where p.personId in ('" + ids + "')");
	}

	
}
